package com.banmao.algorithm.No401To500.No541;

import org.apache.commons.lang3.time.DateFormatUtils;
import org.apache.commons.lang3.time.StopWatch;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class Answer {

    private static final Logger LOGGER = LoggerFactory.getLogger(Answer.class);

    public static void main(String[] args) {

        StopWatch stopWatch = new StopWatch();
        stopWatch.start();

        String s = "abcdefg";

        Solution1 solution = new Solution1();
        String res = solution.reverseStr(s, 3);
        System.out.println(res);


        CarlSolutions.Solution carl1 = new CarlSolutions.Solution();
        res = carl1.reverseStr(s, 3);
        System.out.println(res);

        stopWatch.split();
        LOGGER.info("split: {}", stopWatch.getSplitNanoTime());

        CarlSolutions.Solution2 carl2 = new CarlSolutions.Solution2();
        res = carl2.reverseStr(s, 3);
        System.out.println(res);

        stopWatch.split();
        LOGGER.info("slit: {}", stopWatch.getSplitNanoTime());

        stopWatch.stop();
        LOGGER.info("time: {}", stopWatch.getTime());

        LOGGER.info("start time: {}", DateFormatUtils.format(stopWatch.getStartTime(), "yyyy-MM-dd HH:mm:ss:SSS"));

        LOGGER.info("stop time: {}", DateFormatUtils.format(stopWatch.getStopTime(), "yyyy-MM-dd HH:mm:ss:SSS"));
    }

}
